use craftdig_math::BlkCoord;

use crate::message::Message;

/// Sent on the first tick after a block is placed in the world.
#[derive(Clone)]
pub struct OnPlaceMessage {
    // todo
}

impl OnPlaceMessage {
    pub fn new() -> Self {
        Self {}
    }
}

impl Message for OnPlaceMessage {}

/// Sent on the tick that a block is being replaced with another block, just
/// before the world is actually changed.
#[derive(Clone)]
pub struct PreBreakMessage {
    // todo
}

impl PreBreakMessage {
    pub fn new() -> Self {
        Self {}
    }
}

impl Message for PreBreakMessage {}

/// Sent to all neighboring blocks when a block is replaced or otherwise updated
/// in the world.
#[derive(Clone)]
pub struct NeighborUpdateMessage {
    neighbor_pos: BlkCoord,
}

impl NeighborUpdateMessage {
    pub fn new(neighbor_pos: BlkCoord) -> Self {
        Self { neighbor_pos }
    }

    pub fn neighbor_pos(&self) -> BlkCoord {
        self.neighbor_pos
    }
}

impl Message for NeighborUpdateMessage {}
